package com.eshidai.simple_springboot.mq;

import java.util.Date;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Sender {
	@Autowired
	private AmqpTemplate rabbitTemplate;
	
	public void send(int i) {
		String context = "hello " + i;
		System.out.println("Sender : " + context);
		this.rabbitTemplate.convertAndSend("hello-queue", context);
	}
	
	public void sendTwo(int i) {
		String context = "two " + i;
		System.out.println("Sender : " + context);
		this.rabbitTemplate.convertAndSend("two-queue", context);
	}
}
